-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AHM] Add Polkadot call filtering #559
Conversation
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the approach! We should get input from a wider group on the individual filtered calls/pallets, maybe based on the owners on the excel sheet
relay/polkadot/src/lib.rs
Outdated
// ParaSessionInfo has no calls | ||
ParasDisputes(..) => (OFF, ON), // TODO check with security | ||
ParasSlashing(..) => (OFF, ON), // TODO check with security | ||
OnDemand(..) => (OFF, ON), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we get paritytech/polkadot-sdk#5990 merged in time we should try to avoid filtering on-demand, as there will no longer be a balances dependency and we should avoid a situation where parachains can't make blocks through the migration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add a TODO
relay/polkadot/src/lib.rs
Outdated
Registrar(..) => (OFF, ON), | ||
Slots(..) => (OFF, ON), // TODO not sure | ||
Auctions(..) => (OFF, OFF), | ||
Crowdloan(..) => (OFF, ON), // TODO maybe only payouts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea probably just withdraw
, refund
and dissolve
.
Ideally we'd transfer this state to AH and allow people to withdraw or refund there directly, but it would be basically an entirely new pallet and would break all the crowdloan apps maybe unnecessarily. That's likely going to be the next phase of AHM though when the EDs go up. Still like 20 months until the last crowdloans expire so we need something long term
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The impact is very low, I would just disable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The impact is very low, I would just disable.
You mean also after the migration? I was thinking about enabling the withdraw function after the migration again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to:
Crowdloan(crowdloan::Call::<Runtime>::dissolve { .. } | crowdloan::Call::<Runtime>::refund { .. } | crowdloan::Call::<Runtime>::withdraw { .. }) => (OFF, ON),
Crowdloan(..) => (OFF, OFF),
relay/polkadot/src/lib.rs
Outdated
FastUnstake(..) => (OFF, OFF), | ||
// DelegatedStaking has on calls | ||
// ParachainsOrigin has no calls | ||
Configuration(..) => (OFF, ON), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Configuration(..) => (OFF, ON), | |
Configuration(..) => (ON, ON), |
All root calls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also can have a similar impl for the EnsureOrigin if needed to let only Fellows to command some calls during migration. I do not think we can execute the root fast enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea good idea.
let mut t: sp_io::TestExternalities = | ||
frame_system::GenesisConfig::<T>::default().build_storage().unwrap().into(); | ||
|
||
// MQ calls are never filtered: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we get to the bottom of the prioritisation of system messages? I lost track of the status of your streaking work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea it worked here but we should get it audited & merged paritytech/polkadot-sdk#6059
} | ||
|
||
fn is_forbidden(call: &polkadot_runtime::RuntimeCall) -> bool { | ||
let Err(err) = call.clone().dispatch(RuntimeOrigin::signed(AccountId32::from([0; 32]))) else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually a nice test to run on basically every pallet and extrinsic during the migration except for a few exceptions that are explicitly allowed from signed origins - the ones that are root only will fail anyway from this origin.
We could then have a separate check for the root calls that should be filtered, with the baseline being that all root calls are allowed except the ones we know will cause problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we could do that. Currently we need to manually construct the call arguments as well since our RuntimeCall enum does not implement an Arbitrary
trait.
relay/polkadot/src/lib.rs
Outdated
FastUnstake(..) => (OFF, OFF), | ||
// DelegatedStaking has on calls | ||
// ParachainsOrigin has no calls | ||
Configuration(..) => (OFF, ON), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also can have a similar impl for the EnsureOrigin if needed to let only Fellows to command some calls during migration. I do not think we can execute the root fast enough.
relay/polkadot/src/lib.rs
Outdated
Registrar(..) => (OFF, ON), | ||
Slots(..) => (OFF, ON), // TODO not sure | ||
Auctions(..) => (OFF, OFF), | ||
Crowdloan(..) => (OFF, ON), // TODO maybe only payouts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The impact is very low, I would just disable.
Co-authored-by: Dónal Murray <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Going to merge. Tests should run after #561 |
To be merged into the AHM working branch.
Changes:
Configure the RC Migrator pallet as call filter for the Polkadot Relay chain
Test
Does not require a CHANGELOG entry